package org.luckystrophe.snowtoms.model.impl;

import android.os.Parcel;
import android.os.Parcelable;

public class PostActivityIntent implements Parcelable {

	public static final int ORDINARY_MESSAGE = 0;
	public static final int AUTH_MESSAGE = 1;
	public static final int REPORT_MESSAGE = 2;
	public static final int NOTICE = 9;

	public int strictSetLocation;
	public int strictSetImage;
	public int isNullComment;
	public int messageType;
	public String activityTitle;

	public PostActivityIntent(boolean _strictSetLocation, boolean _strictSetImage, boolean _isNullComment,
			int messageType) {
		this.strictSetLocation = _strictSetLocation ? 1 : 0;
		this.strictSetImage = _strictSetImage ? 1 : 0;
		this.isNullComment = _isNullComment ? 1 : 0;
		this.messageType = messageType;
		if (messageType == 0) {
			this.activityTitle = "글쓰기";
		} else if (messageType == 1) {
			this.activityTitle = "인증샷";
		} else if (messageType == 2) {
			this.activityTitle = "제보";
		}
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(strictSetLocation);
		dest.writeInt(strictSetImage);
		dest.writeInt(isNullComment);
		dest.writeInt(messageType);
		dest.writeString(activityTitle);
	}

	public static final Parcelable.Creator<PostActivityIntent> CREATOR = new Creator<PostActivityIntent>() {

		@Override
		public PostActivityIntent createFromParcel(Parcel source) {
			int strictSetLocation = source.readInt();
			int strictSetImage = source.readInt();
			int isNullComment = source.readInt();
			int messageType = source.readInt();
			return new PostActivityIntent(strictSetLocation == 1, strictSetImage == 1, isNullComment == 1, messageType);
		}

		@Override
		public PostActivityIntent[] newArray(int size) {
			return new PostActivityIntent[size];
		}

	};

	@Override
	public int describeContents() {
		return 0;
	}

	public boolean isStrictSetLocation() {
		return strictSetLocation == 1;
	}

	public void setStrictSetLocation(boolean strictSetLocation) {
		this.strictSetLocation = strictSetLocation ? 1 : 0;
	}

	public boolean isStrictSetImage() {
		return strictSetImage == 1;
	}

	public void setStrictSetImage(boolean strictSetImage) {
		this.strictSetImage = strictSetImage ? 1 : 0;
	}

	public boolean isNullComment() {
		return isNullComment == 1;
	}

	public void setNullComment(boolean isNullComment) {
		this.isNullComment = isNullComment ? 1 : 0;
	}

	public int getMessageType() {
		return messageType;
	}

	public void setMessageType(int messageType) {
		this.messageType = messageType;
	}

	public String getActivityTitle() {
		return activityTitle;
	}

	public void setActivityTitle(String activityTitle) {
		this.activityTitle = activityTitle;
	}

}
